//
//  JGOrderToSetContentView.m
//  JGRider
//
//  Created by 单启志 on 2018/1/31.
//  Copyright © 2018年 ffq. All rights reserved.
//

#import "JGOrderToSetContentView.h"
@interface JGOrderToSetContentView()

@property (weak, nonatomic) IBOutlet UILabel *addressLab;
@property (weak, nonatomic) IBOutlet UILabel *scopeLab;

@property (weak, nonatomic) IBOutlet UIButton *changeAddressBtn;
@property (weak, nonatomic) IBOutlet UIButton *changeScopeBtn;

@end

@implementation JGOrderToSetContentView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self=[super initWithFrame:frame]) {
       self=[[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil]lastObject];
        self.frame=frame;
    }
    return self;
}



-(void)awakeFromNib{

    [super awakeFromNib];
}

//修改位置
- (IBAction)onChangeAddressBtnClick:(id)sender {

    if ([self.delegate respondsToSelector:@selector(ChangeAddressEvent:)]) {
        [self.delegate ChangeAddressEvent:sender];
    }
}

//修改接单范围
- (IBAction)onChangeScopeBtnClick:(id)sender {

    if ([self.delegate respondsToSelector:@selector(changeScopeEvent:)]) {
        [self.delegate changeScopeEvent:sender];
    }

}

-(void)layoutSubviews{
    [super layoutSubviews];
    self.changeAddressBtn.layer.cornerRadius=AdaptedWidth(3);
    self.changeAddressBtn.layer.masksToBounds=YES;
    self.changeAddressBtn.layer.borderColor=HEXCOLOR(0x333333).CGColor;
    self.changeAddressBtn.layer.borderWidth=0.5;

    self.changeScopeBtn.layer.cornerRadius=AdaptedWidth(3);
    self.changeScopeBtn.layer.masksToBounds=YES;
    self.changeScopeBtn.layer.borderColor=HEXCOLOR(0x333333).CGColor;
    self.changeScopeBtn.layer.borderWidth=0.5;

}

-(void)setAddress:(NSString *)address{
    _address=address;
    self.addressLab.text=address;

}

-(void)setScope:(NSString *)scope{
    _scope=scope;
    self.scopeLab.text=scope;
}

@end
